package com.bwda.dsrs.systemservice.domain.form.adminlog;

import com.bwda.dsrs.base.util.DateUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.util.Date;
/**
 * 管理日志更新表单
 *
 * @author yanyuemei
 * @date 2019/4/27
 */
@Data
@ApiModel(description = "系统日志，登录，部门组织机构等模块的日志")
public class AdminLogUpdateForm {

	@ApiModelProperty(value = "ID", required = true)
	@NotNull(message = "ID不能为空")
	private Integer id;

	@ApiModelProperty(value = "用户编号")
	private String userCode;

	@ApiModelProperty(value = "用户姓名")
	private String userName;

	@ApiModelProperty(value = "组织ID")
	private Integer orgId;

	@ApiModelProperty(value = "组织名称")
	private String orgName;

	@ApiModelProperty(value = "IP地址")
	private String ipAddr;

	@ApiModelProperty(value = "访问客户端标识")
	private String userAgent;

	@ApiModelProperty(value = "请求URI")
	private String requestUri;

	@ApiModelProperty(value = "请求方式get,post")
	private String method;

	@ApiModelProperty(value = "访问参数")
	private String params;

	@ApiModelProperty(value = "请求内容")
	private String requestContent;

	@ApiModelProperty(value = "结果")
	private String result;

	@ApiModelProperty(value = "0系统日志，1同步日志，2三方接口，3....")
	private Integer logType;

	@ApiModelProperty(value = "异常信息")
	private String exceptionMsg;

	@ApiModelProperty(value = "登录token")
	private String loginToken;

	@ApiModelProperty(value = "创建时间,格式为:" + DateUtil.FORMAT)
	@DateTimeFormat(pattern = DateUtil.FORMAT)
	private Date createTime;

	public Date getCreateTime() {
		if (createTime != null){
			return (Date) createTime.clone();
		}

		return null;
	}

	public void setCreateTime(Date createTime) {
		if (createTime != null){
			this.createTime = (Date) createTime.clone();
		}
	}
}